package com.suray.socket.system;

import com.suray.basic.wcs.utils.LoggerType;
import com.suray.basic.wcs.utils.LoggerUtil;
import com.suray.basic.wcs.utils.ModuleType;
import com.suray.socket.core.SocketInstance;

public class SocketApp {
    public static void init() {
        LoggerUtil.info(ModuleType.WCS_SYSTEM, LoggerType.TEST, null, null,
                "Socket通讯模块初始化", SocketApp.class);
//        NetAddress netAddress = new NetAddress(1,"127.0.0.1", 2503);
//        SocketImpl socket = new SocketImpl(netAddress, SocketType.CLIENT);
//        socket.start();
//        SocketInstance.put(1, socket);

        SocketCreateImpl socketCreate = new SocketCreateImpl();
        SocketInstance.initSocketCreate(socketCreate);
    }

    public static void run() {
        LoggerUtil.info(ModuleType.WCS_SYSTEM, LoggerType.TEST, null, null,
                "Socket通讯模块运行", SocketApp.class);
//        SocketInterface socket = SocketInterface.sockets.get(1);
//        socket.sendData(new byte[]{1,2,3,4,5,6,7,8,9,0});
//        byte[] data = socket.recData();
//        LoggerUtil.info(ModuleType.SOCKET, LoggerType.INFO, 0, null, "接收到的数据：" + Arrays.toString(data), SocketApp.class);
    }
}
